import { enableProdMode, ViewEncapsulation } from '@angular/core'
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
import { preloaderFinished } from '@delon/theme'

import { AppModule } from './app/app.module'
import { environment } from './environments/environment'

preloaderFinished()

if (environment.production) {
  enableProdMode()
}

const bootstrap = () => {
  return platformBrowserDynamic().bootstrapModule(AppModule, {
    defaultEncapsulation: ViewEncapsulation.Emulated,
    preserveWhitespaces: false,
  })
}

bootstrap().then(() => {
  if ((<any>window).appBootstrap) {
    (<any>window).appBootstrap()
  }
})
